package com.koron.sinoprobe.web.engineering.bean.vo;

import com.koron.sinoprobe.web.engineering.bean.po.SpDivision;
import com.koron.sinoprobe.web.engineering.bean.po.SpEstablish;
import com.koron.sinoprobe.web.engineering.bean.po.SpSettlementAudit;
import com.koron.sinoprobe.web.ledger.bean.entity.SpProject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author jzp
 * @since 2021/12/2
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SpSettlementAuditVO extends SpSettlementAudit {
    @ApiModelProperty(value = "当前节点名称")
    private String currNodeName;

    @ApiModelProperty(value = "当前节点处理人")
    private String currNodeUser;

    /**
     * 项目编号 w_sp_project.code
     */
    @ApiModelProperty("项目编号")
    private String code;

    /**
     * 项目编号 w_sp_project.name
     */
    @ApiModelProperty("项目名称")
    private String projectName;

    @ApiModelProperty("项目立项基本信息")
    private SpEstablish spEstablish;

    @ApiModelProperty("项目基本信息")
    private SpProject spProject;

    @ApiModelProperty("项目划分信息")
    private SpDivision spDivision;

    @Override
    public String getContractId() {
        return super.getContractId() != null ? super.getContractId() : getSpDivision() == null ? null : getSpDivision().getContractId();
    }

    @Override
    public String getContractCode() {
        return super.getContractCode() != null ? super.getContractCode() : getSpDivision() == null ? null : getSpDivision().getContractCode();
    }

    @Override
    public Double getContractPrice() {
        return super.getContractPrice() != null ? super.getContractPrice() : getSpDivision() == null ? null : getSpDivision().getContractPrice();
    }

    @Override
    public String getBudgetNum() {
        return super.getBudgetNum() != null ? super.getBudgetNum() : getSpEstablish() == null ? null : getSpEstablish().getBudgetNum();
    }

    @Override
    public Double getBudget() {
        return super.getBudget() != null ? super.getBudget() : getSpEstablish() == null ? null : getSpEstablish().getBudget();
    }
}
